<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Amaze UI Admin user Examples</title>
  <meta name="description" content="这是一个 user 页面">
  <meta name="keywords" content="user">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="/Public/AmazeUI-2.4.2/assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="/Public/AmazeUI-2.4.2/assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="/Public/AmazeUI-2.4.2/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="/Public/AmazeUI-2.4.2/assets/css/admin.css">
  <link rel="stylesheet" href="/Public/tools/php_img_upload/control/css/zyUpload.css" type="text/css">

</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<header class="am-topbar am-topbar-inverse admin-header">
<!doctype html>
<html class="no-js">
<body>
  <div class="am-topbar-brand">
    <strong>拍拍拍 BuyBuy</strong> <small>后台管理模板</small>
  </div>

  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

  <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

    <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
      <li><a href="javascript:;"><span class="am-icon-envelope-o"></span> 收件箱 <span class="am-badge am-badge-warning">5</span></a></li>
      <li class="am-dropdown" data-am-dropdown>
        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
          <span class="am-icon-users"></span><?php echo ($account_name); ?><span class="am-icon-caret-down"></span>
        </a>
        <ul class="am-dropdown-content">
          <li><a href="#"><span class="am-icon-user"></span> 资料</a></li>
          <li><a href="#"><span class="am-icon-cog"></span> 设置</a></li>
          <li><a href="/Admin/Login/loginout"><span class="am-icon-power-off"></span> 退出</a></li>
        </ul>
      </li>
      <li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
    </ul>
  </div>
</body>

</header>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <!doctype html>
<html class="no-js fixed-layout"> 
<body>
 <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
      <ul class="am-list admin-sidebar-list">
        <li><a href="/Admin/Index"><span class="am-icon-home"></span> 首页</a></li>
        <li class="admin-parent">
          <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-file"></span> 页面模块 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
          <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav">
			  <li><a href="/Admin/Account/account" class="am-cf"><span class="am-icon-check"></span> 管理员添加<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
           
             <li><a href="/Admin/Type/typelist" class="am-cf"><span class="am-icon-check"></span>页面类别显示<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
         <li><a href="/Admin/Shop/alist" class="am-cf"><span class="am-icon-check"></span>商品管理<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
          <li><a href="/Admin/Type/shoptype" class="am-cf"><span class="am-icon-check"></span>商品类别增加<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
          <li><a href="/Admin/Type/shoptypelist" class="am-cf"><span class="am-icon-check"></span>商品类别显示<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
         <li><a href="/Admin/Article/lunbo" class="am-cf"><span class="am-icon-check"></span>商品轮播管理<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
         <li><a href="/Admin/Photo/photo_alist" class="am-cf"><span class="am-icon-check"></span>商品相册页面<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
          </ul>
        </li>
        <li><a href="admin-table.html"><span class="am-icon-table"></span> 表格</a></li>
        <li><a href="admin-form.html"><span class="am-icon-pencil-square-o"></span> 表单</a></li>
        <li><a href="/Admin/Login/loginout"><span class="am-icon-sign-out"></span> 注销</a></li>
      </ul>

      <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-bookmark"></span> 公告</p>
          <p>时光静好，与君语；细水流年，与君同。—— Amaze UI</p>
        </div>
      </div>

      <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-tag"></span> wiki</p>
          <p>Welcome to the Amaze UI wiki!</p>
        </div>
      </div>
    </div>
  </div>
 </body>

  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">添加商品</strong> / <small>Personal information</small></div>
      </div>

      <hr/>

      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">
          <div class="am-panel am-panel-default">
            <div class="am-panel-bd">
              <div class="am-g">
                <div class="am-u-md-4">
                  <img class="am-img-circle am-img-thumbnail" src="http://s.amazeui.org/media/i/demos/bw-2014-06-19.jpg?imageView/1/w/200/h/200/q/80" alt=""/>
                </div>
                <div class="am-u-md-8">
                  <p>你可以使用<a href="#">gravatar.com</a>提供的头像或者使用本地上传头像。 </p>
                  <form class="am-form" enctype="multipart/form-data">
                    <div class="am-form-group">
                      <input type="file" id="user-pic">
                      <p class="am-form-help">请选择要上传的文件...</p>
                      <button type="button" class="am-btn am-btn-primary am-btn-xs">保存</button>
                    </div>
                  </form>
                </div>
              </div>
            </div>
          </div>

          <div class="am-panel am-panel-default">
            <div class="am-panel-bd">
              <div class="user-info">
                <p>等级信息</p>
                <div class="am-progress am-progress-sm">
                  <div class="am-progress-bar" style="width: 60%"></div>
                </div>
                <p class="user-info-order">当前等级：<strong>LV8</strong> 活跃天数：<strong>587</strong> 距离下一级别：<strong>160</strong></p>
              </div>
              <div class="user-info">
                <p>信用信息</p>
                <div class="am-progress am-progress-sm">
                  <div class="am-progress-bar am-progress-bar-success" style="width: 80%"></div>
                </div>
                <p class="user-info-order">信用等级：正常当前 信用积分：<strong>80</strong></p>
              </div>
            </div>
          </div>

        </div>

        <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
          <form class="am-form am-form-horizontal" name="article_form" action="/Admin/Shop/addShop?shop_id=<?php echo ($res["shop_id"]); ?>" enctype="multipart/form-data" method="post">
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-3 am-form-label">商品标题</label>
              <div class="am-u-sm-9">
                <input type="text" name="title" id="user-name" value="<?php echo ($res["title"]); ?>" placeholder="商品标题">
              </div>
            </div>
			<div class="am-form-group">
				  <label for="doc-select-1" class="am-u-sm-3 am-form-label">页面类别</label>
					 <div class="am-u-sm-9">
					
						  <select name="type_id" id="doc-select-1" >
								<option>--请选择类别--</option>
							 <?php if(is_array($type_ret)): $i = 0; $__LIST__ = $type_ret;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["type_id"]); ?>"><?php echo ($vo["type_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						  </select>
						  
					 </div>
				  <span class="am-form-caret"></span>
			</div>
			<div class="am-form-group">
				  <label for="doc-select-1" class="am-u-sm-3 am-form-label">商品类别</label>
					 <div class="am-u-sm-9">
					
						  <select name="shoptype_id" id="doc-select-1" >
								<option>--请选择类别--</option>
							 <?php if(is_array($shoptype_ret)): $i = 0; $__LIST__ = $shoptype_ret;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vv["shoptype_id"]); ?>"><?php echo ($vv["shoptype_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						  </select>
						  
					 </div>
				  <span class="am-form-caret"></span>
			</div>
			<div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">口味/包装</label>
              <div class="am-u-sm-9">
                <input type="text" name="kouwei" id="kouwei" value="<?php echo ($res["kouwei"]); ?>" placeholder="口味：/原味/奶油/炭烧/生吞">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">商家</label>
              <div class="am-u-sm-9">
                <input type="email" name="seller" id="user-email" value="<?php echo ($res["seller"]); ?>" placeholder="商家">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">价格</label>
              <div class="am-u-sm-9">
                <input type="email" name="price" id="user-email" value="<?php echo ($res["price"]); ?>" placeholder="售价">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">商家</label>
              <div class="am-u-sm-9">
                <input type="email" name="cxprice" id="user-email" value="<?php echo ($res["cxprice"]); ?>" placeholder="促销价">
              </div>
            </div>
			<div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">库存</label>
              <div class="am-u-sm-9">
                <input type="email" name="num" id="user-email" value="<?php echo ($res["num"]); ?>" placeholder="库存">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-phone" class="am-u-sm-3 am-form-label">封面图</label>
              <div class="am-u-sm-9">
               
                <!--img src="<?php echo ($res["picture"]); ?>" style="width:100px"/-->
                <span id="user-pic-src" >
                           
                </span>
                
                
                <button
				  type="button"
				  class="am-btn am-btn-primary"
				  data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0, width: 400, height: 225}">
				  Modal
				</button>
              </div>
            </div>

           

            <div class="am-form-group">
              <label for="user-weibo" class="am-u-sm-3 am-form-label">商品简介</label>
              <div class="am-u-sm-9">
                <textarea type="text" name="present" id="user-weibo" placeholder="输入商品简介"><?php echo ($res["present"]); ?></textarea>
              </div>
            </div>

            <div class="am-form-group">
              <label for="user-intro" class="am-u-sm-3 am-form-label">商品内容</label>
              <div class="am-u-sm-9">
					<script id="container" name="content" type="text/plain"><?php echo ($res["content"]); ?></script>
              </div>
              
            </div>

            <div class="am-form-group">
              <div class="am-u-sm-9 am-u-sm-push-3">
                <button type="button" onclick="do_submit()" class="am-btn am-btn-primary">保存修改</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>

    <!doctype html>
<html class="no-js">

<body>
  <footer>
  <hr>
  <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
  </footer>
</body>


  </div>
  <!-- content end -->

</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<!-------模态窗口上传文件-------->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
  
	    <div id="demo" class="demo"></div>   
	    <div id="successinfo">
	    
	    </div>
 
</div>
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="AmazeUI-2.4.2/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/Public/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/Public/AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>

<script src="/Public/AmazeUI-2.4.2/assets/js/app.js"></script>
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="/Public/tools/UEditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/Public/tools/UEditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<!-- 上传文件样式 -->
<!--图片弹出层样式 必要样式-->
<!-- 引用核心层插件 -->
<script type="text/javascript" src="/Public/tools/php_img_upload/core/zyFile.js"></script>
<!-- 引用控制层插件 -->
<script type="text/javascript" src="/Public/tools/php_img_upload/control/js/zyUpload.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('container');
function do_submit(){
	document.article_form.submit();
}
var shop_id = '<?php echo ($res["shop_id"]); ?>';
$(function(){
	// 初始化插件
	var width = $(window).width();
	if ( width >= 650 )	 width = '750px';
	else 	width = "100%";

	$("#demo").zyUpload({
		width            :   width,                 // 宽度
		height           :   "auto",                 // 宽度
		itemWidth        :   "140px",                 // 文件项的宽度
		itemHeight       :   "100px",                 // 文件项的高度
		//url              :   "/upload/UploadAction",  // 上传文件的路径
		url              :   "/Api/Photo/imgphotos?shop_id="+shop_id,
		inputName		 : 	'_img',
		id 				 :	 1,
		multiple         :   true,                    // 是否可以多个文件上传
		dragDrop         :   false,                    // 是否可以拖动上传文件
		del              :   true,                    // 是否可以删除文件
		finishDel        :   false,  				  // 是否在上传文件完成后删除预览
		/* 外部获得的回调接口 */
		onSelect: function(selectFiles, allFiles){    // 选择文件的回调方法  selectFile:当前选中的文件  allFiles:还没上传的全部文件
			console.info("当前选择了以下文件：");
			console.info(selectFiles);
		},
		onProgress: function(file, loaded, total){    // 正在上传的进度的回调方法
			var eleProgress = $("#uploadProgress_" + file.index), percent = (loaded / total * 100).toFixed(2) + '%';
			eleProgress.html(percent);
			console.info(file.index);
			console.info("当前正在上传此文件：");
			console.info(file.name);
			console.info("进度等信息如下：");
			console.info(loaded);
			console.info(total);
		},   
		onDelete: function(file, files){              // 删除一个文件的回调方法 file:当前删除的文件  files:删除之后的文件
			console.info("当前删除了此文件：");
			console.info(file.name);
		},
		onSuccess: function(file, response){          // 文件上传成功的回调方法
			var  json = eval('('+response+')');
			console.info("此文件上传成功：");
			
			$('#successinfo').append("<p>"+response+"</p>");
			console.log(response);
			var html = '<img style="width:100px;height:100px;" src="'+json.data+'"/><input style="display:none" value="'+json.data+'" name="picture[]"/>';
			$('#user-pic-src').append(html);
		},
		onFailure: function(file, response){          // 文件上传失败的回调方法
			$("#uploadImage_" + file.index).css("opacity", 0.2);
			console.info("此文件上传失败：");
			console.info(file.name);
		},
		onComplete: function(response){           	  // 上传完成的回调方法
			console.info("文件上传完成");
			console.info(response);
			$('#doc-modal-1').modal('close');
		}
	});
	
});
</script>
</body>
</html>